/**
* 衣服编辑面板的基类 
*/
namespace ghost{
	export class EditBase extends GYSprite{
		public back:Laya.Sprite;
		public closeBtn:GYSprite;
		constructor(){
			super();
			let s = this;
			s.back = new Laya.Sprite;
			s.addChild(s.back);
			s.back.graphics.drawRect(0,0,600,600,"#eeeeee","#0000ff",2);
			s.closeBtn = new GYSprite;			
			s.addChild(s.closeBtn);
			s.closeBtn.graphics.drawRect(0,0,30,30,"#ff0000","#0000ff",2);
			s.closeBtn.on(Laya.Event.CLICK, s, s.oper);
			s.closeBtn.width = 30;
			s.closeBtn.height = 30;
			s.closeBtn.right = 20;
			s.closeBtn.y = 20;
		}
		private oper(e:Laya.Event):void				
		{
			let s= this;
			s.hide();
		}
		public show(pr:Laya.Sprite):void
        {
            pr.addChild(this);
            let s= this;
            s.layout();
        }
        public hide():void
        {
            let s= this;
            if(s.parent)
            {
                s.parent.removeChild(s);
            }
        }
		public setSize(w:number,h:number):void
		{
			let s= this;
			s.width = w;
			s.height = h;
			s.back.graphics.clear();
			s.back.graphics.drawRect(0,0,w,h,"#eeeeee","#0000ff",1);
			s.closeBtn.layout();
		}
		
	}
}